<?php

namespace App\Console\Commands;

use App\Jobs\Viewer;
use App\Services\CrawlerService\CrawlerService;
use App\Services\CrawlerService\driver\Xinxin21ccnnDriver;
use Illuminate\Console\Command;

class WechatMenu extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'WechatMenu';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @param $driver
     * @return mixed
     */
    public function handle()
    {

        $app = app('wechat.official_account');
        $buttons = [
            [
                'type'       => 'view',
                'name'       => mb_convert_encoding("招聘", 'UTF-8', 'UTF-8'),
                'url'        => 'http://feier.bicobrand.com',
                'sub_button' => [],
            ]
        ];
        $this->info(json_encode($app->menu->create($buttons)));
    }
}
